<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function getResult() {
            // 为什么会有数据处理，因为有arguments，自动获取传值
            // 求和
            var sum = 0,
            max=arguments[0],
            min=arguments[0];
            for (var i = 0; i < arguments.length; i++) {
                sum += arguments[i];
                if(max<arguments[i]){
                    max=arguments[i]
                }
                if(min>arguments[i]){
                    min=arguments[i]
                }
            }
          
            var averages = (sum / arguments.length).toFixed(2);

            // 数据处理完了之后，这边会吧处理好得数据传出去

            return {
                sum: sum,
                max: max,
                min: min,
                averages: averages
            }
        }

        console.log(getResult(5, 91, 6, 64, 16, 5, 6, 11, 5, 2, 61, 51, 516));

    </script>
</head>

<body>

</body>

</html>